
package cartagows.wsframework.wssecurity.policy.model;

import cartagows.wsframework.wssecurity.policy.SPConstants;

public abstract class SymmetricAsymmetricBindingBase extends Binding {

    private String protectionOrder = SPConstants.SIGN_BEFORE_ENCRYPTING;   
    private boolean signatureProtection;    
    private boolean tokenProtection;    
    private boolean entireHeadersAndBodySignatures;
    
    public SymmetricAsymmetricBindingBase(int version) {
        super(version);
    }

    public boolean isEntireHeadersAndBodySignatures() {
        return entireHeadersAndBodySignatures;
    }

    public void setEntireHeadersAndBodySignatures(
            boolean entireHeaderAndBodySignatures) {
        this.entireHeadersAndBodySignatures = entireHeaderAndBodySignatures;
    }

    public String getProtectionOrder() {
        return protectionOrder;
    }

    public void setProtectionOrder(String protectionOrder) {
        if(SPConstants.ENCRYPT_BEFORE_SIGNING.equals(protectionOrder) ||
           SPConstants.SIGN_BEFORE_ENCRYPTING.equals(protectionOrder)) {
            this.protectionOrder = protectionOrder;
        } else {
//            throw new WSSPolicyException("Incorrect protection order value : "
//                    + protectionOrder);
        }
    }

    public boolean isSignatureProtection() {
        return signatureProtection;
    }

    public void setSignatureProtection(boolean signatureProtection) {
        this.signatureProtection = signatureProtection;
    }

    public boolean isTokenProtection() {
        return tokenProtection;
    }

    public void setTokenProtection(boolean tokenProtection) {
        this.tokenProtection = tokenProtection;
    }
    
    
    
}
